<script setup lang="ts">
const {waterForm, listB} = defineProps<{
  waterForm: Object;  // 定义采样时间的类型
  listB: Object;
}>();

// ✅ 公共计算方法
const calculateDifference = (fieldPrefix) => {
  const num1 = parseFloat(waterForm.bdgc[`${fieldPrefix}1`]);
  const num2 = parseFloat(waterForm.bdgc[`${fieldPrefix}2`]);

  console.log(`计算 ${fieldPrefix}3:`, num1, num2);

  // 确保输入是有效数字，否则不计算
  waterForm.bdgc[`${fieldPrefix}3`] = (!isNaN(num1) && !isNaN(num2))
      ? (num2 - num1).toFixed(2)
      : "";

  calculateBdDyc4(fieldPrefix)
};

const calculateBdDyc4 = (fieldPrefix) => {
  const bd_dyc3 = parseFloat(waterForm.bdgc[`${fieldPrefix}3`]);
  const bd_qjzrytj = parseFloat(waterForm.bdgc.bd_qjzrytj);
  const ry_jzwznd = parseFloat(waterForm.rypz.ry_jzwznd);

  console.log(`计算 ${fieldPrefix}4:`, bd_dyc3, bd_qjzrytj, ry_jzwznd);

  if (!isNaN(bd_dyc3) && !isNaN(bd_qjzrytj) && !isNaN(ry_jzwznd) && bd_dyc3 !== 0) {
    waterForm.bdgc[`${fieldPrefix}4`] = ((bd_qjzrytj * ry_jzwznd) / bd_dyc3).toFixed(6);
  } else {
    waterForm.bdgc[`${fieldPrefix}4`] = "";
  }

  calculateAverageC0()
};

const calculateAverageC0 = () => {
  const values = [
    parseFloat(waterForm.bdgc.bd_dyc4),
    parseFloat(waterForm.bdgc.bd_dec4),
    parseFloat(waterForm.bdgc.bd_dsc4),
    parseFloat(waterForm.bdgc.bd_dsic4),
  ];

  // 过滤掉 NaN 值，确保所有数值有效
  const validValues = values.filter(v => !isNaN(v));

  if (validValues.length === 4) {
    // 计算平均值
    const avg = validValues.reduce((sum, v) => sum + v, 0) / 4;

    // **四舍五入并保留 5 位小数**
    waterForm.bdgc.bd_bzryndC0 = (Math.round(avg * 100000) / 100000).toFixed(5);
  } else {
    // **如果有缺失值，则不填写**
    waterForm.bdgc.bd_bzryndC0 = "";
  }
};


// 空白
const handleKbyChange = (item) => {
  // 根据选中的样品编号，找到对应的 finalResult
  const selectedOption = listB.kbyList.find(
      option => option.sampleNumber === item.kb_ypbh
  );

  // 如果找到了对应的选项，则将 finalResult 赋值给 px_phz
  if (selectedOption) {
    item.kb_ypnd = selectedOption.finalResult;
  }
}

// 标准
const handleBzyChange = (item) => {
  // 根据选中的样品编号，找到对应的 finalResult
  const selectedOption = listB.bzyList.find(
      option => option.extractedContent === item.bz_ypph
  );

  console.log(selectedOption)

  // 如果找到了对应的选项，则将 finalResult 赋值给 px_phz
  if (selectedOption) {
    item.bz_cdnd = selectedOption.finalResult;
  }
}


// 加标
const handleJzyChange = (item) => {
  // 根据选中的样品编号，找到对应的 finalResult
  const selectedOption = listB.jbyList.find(
      option => option.sampleNumber === item.jb_ybph
  );

  // 如果找到了对应的选项，则将 finalResult 赋值给 px_phz
  if (selectedOption) {
    item.jb_bynd = selectedOption.finalResult;
  }
}


const handlePxyChange = (selectKey) => {
  // 获取对应的样品编号
  const selectedSampleNumber = waterForm.pxycd_fx[selectKey];

  // 在 pxyList 中查找匹配的样品
  const selectedSample = listB.pxyList.find(
      sample => sample.sampleNumber === selectedSampleNumber
  );

  // 填充浓度信息到相应的字段
  if (selectKey === 'bt_1') {
    waterForm.pxycd_fx.cdnd_1 = selectedSample.finalResult;
  } else if (selectKey === 'bt_2') {
    waterForm.pxycd_fx.cdnd_2 = selectedSample.finalResult;
  } else if (selectKey === 'bt_3') {
    waterForm.pxycd_fx.cdnd_3 = selectedSample.finalResult;
  } else if (selectKey === 'bt_4') {
    waterForm.pxycd_fx.cdnd_4 = selectedSample.finalResult;
  } else if (selectKey === 'bt_5') {
    waterForm.pxycd_fx.cdnd_5 = selectedSample.finalResult;
  } else if (selectKey === 'bt_6') {
    waterForm.pxycd_fx.cdnd_6 = selectedSample.finalResult;
  }
}

</script>

<template>
  <el-card class="box-card">
    <div style="text-align: center;display: flex;align-items: center;justify-content: space-between">
      <h3>SXLPHJ/JL/CX-22-52</h3>
      <h1>水质 容量法分析原始记录(B面)</h1>
      <div style="display: flex;align-items: center;">
        <span style="width: 140px;">标定日期：</span>
        <el-input style="border: 1px solid #ccc;border-radius: 6px" placeholder="请输入"
                  v-model="waterForm.bdrq"></el-input>
      </div>
    </div>
    <table class="table">
      <tr>
        <td colspan="8" style="text-align: center">溶液配制</td>
      </tr>
      <tr style="background-color: #f2f2f2">
        <td colspan="2">标准溶液名称</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.bz_ryname2"/>
        </td>
        <td colspan="2">标准物质批号/生产厂商</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.manufacturer"/>
        </td>
      </tr>
      <tr>
        <td colspan="2">标准物质取样质量（g）</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.sampleWeight"/>
        </td>
        <td colspan="2">定容体积（mL）</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.dilutionVolume"/>
        </td>
      </tr>
      <tr style="background-color: #f2f2f2">
        <td colspan="2">配置日期</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.configurationDate"/>
        </td>
        <td colspan="2">
          <div>
            标准物质浓度（
            <el-input placeholder="请输入" v-model="waterForm.unit.ry_bzwznd" style="width: 20%;"></el-input>
            ）
          </div>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.standardConcentration"/>
        </td>
      </tr>
      <tr>
        <td colspan="2">基准溶液名称</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.jz_ryname2"/>
        </td>
        <td colspan="2">基准物质批号/生产厂商</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.referenceManufacturer"/>
        </td>
      </tr>
      <tr style="background-color: #f2f2f2">
        <td colspan="2">基准物质取样质量（g）</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.referenceSampleWeight"></el-input>
        </td>
        <td colspan="2">定容体积（mL）</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.referenceDilutionVolume"></el-input>
        </td>
      </tr>
      <tr>
        <td colspan="2">配置日期</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.referenceConfigurationDate"></el-input>
        </td>
        <td colspan="2">
          <div>基准物质浓度（
            <el-input placeholder="请输入" v-model="waterForm.unit.ry_jzwznd" style="width: 20%;"></el-input>
            ）
          </div>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.rypz.ry_jzwznd"></el-input>
        </td>
      </tr>
      <tr>
        <td colspan="8" style="text-align: center">标定过程</td>
      </tr>
      <tr style="background-color: #f2f2f2">
        <td>取基准溶液体积</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.bdgc.bd_qjzrytj"></el-input>
        </td>
        <td>溶剂</td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.bdgc.bd_rj"></el-input>
        </td>
        <td>定容体积（ml）</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.bdgc.drtj"></el-input>
        </td>
      </tr>
      <tr>
        <td>计算公式</td>
        <td colspan="7">
          <el-input style="width: 100%;border: 1px solid transparent " placeholder="请输入"
                    v-model="waterForm.bdgc.bd_formula"/>
        </td>
      </tr>
      <tr style="background-color: #f2f2f2">
        <td rowspan="2" colspan="2">滴定次数</td>
        <td colspan="4" style="text-align: center">滴定体积（mL）</td>
        <td colspan="2" rowspan="2">标准溶液标定浓度C（ ）</td>
      </tr>
      <tr style="background-color: #f2f2f2">
        <td>始读数</td>
        <td colspan="2">终读数</td>
        <td>净用量V</td>
      </tr>
      <tr>
        <td colspan="2">第一次</td>
        <td>
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dyc1" @blur="calculateDifference('bd_dyc')"/>
        </td>
        <td colspan="2">
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dyc2" @blur="calculateDifference('bd_dyc')"/>
        </td>
        <td>
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dyc3"/>
        </td>
        <td colspan="2">
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dyc4"/>
        </td>
      </tr>

      <tr>
        <td colspan="2">第二次</td>
        <td>
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dec1" @blur="calculateDifference('bd_dec')"/>
        </td>
        <td colspan="2">
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dec2" @blur="calculateDifference('bd_dec')"/>
        </td>
        <td>
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dec3"/>
        </td>
        <td colspan="2">
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dec4"/>
        </td>
      </tr>

      <tr>
        <td colspan="2">第三次</td>
        <td>
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dsc1" @blur="calculateDifference('bd_dsc')"/>
        </td>
        <td colspan="2">
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dsc2" @blur="calculateDifference('bd_dsc')"/>
        </td>
        <td>
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dsc3"/>
        </td>
        <td colspan="2">
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dsc4"/>
        </td>
      </tr>

      <tr>
        <td colspan="2">第四次</td>
        <td>
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dsic1" @blur="calculateDifference('bd_dsic')"/>
        </td>
        <td colspan="2">
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dsic2" @blur="calculateDifference('bd_dsic')"/>
        </td>
        <td>
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dsic3"/>
        </td>
        <td colspan="2">
          <el-input placeholder="请输入" v-model="waterForm.bdgc.bd_dsic4"/>
        </td>
      </tr>
      <tr>
        <td colspan="2">4平行极差的相对值</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.bdgc.bd_4pxjcdxdz"/>
        </td>
        <td colspan="2">重复性临界极差CrR95(4)</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.bdgc.bd_cfxljjc"/>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <div>标准溶液浓度C₀(
            <el-input placeholder="请输入" v-model="waterForm.unit.bd_bzrynd" style="width: 20%;"></el-input>
            )
          </div>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.bdgc.bd_bzryndC0"/>
        </td>
        <td colspan="2">标准溶液校正系数</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.bdgc.bd_bzryjzxs"/>
        </td>
      </tr>

      <tr>
        <td colspan="8" style="text-align: center;">空白检查</td>
      </tr>
      <tr>
        <td style="text-align: center" colspan="2">样品编号</td>
        <td colspan="2" style="text-align: center">
          <div>样品浓度(
            <el-input placeholder="请输入" v-model="waterForm.unit.kb_ypnd" style="width: 20%;"></el-input>
            )
          </div>
        </td>
        <td style="text-align: center" colspan="2">质控要求</td>
        <td colspan="2" style="text-align: center">是否合格</td>
      </tr>
      <tr v-for="(item, index) in waterForm.kbycd" :key="index">
        <td colspan="2" style="text-align: center">
          <el-select v-model="item.kb_ypbh" placeholder="请选择" style="width: 100%; border: 1px solid transparent"
                     filterable
                     allow-create
                     default-first-option
                     @change="handleKbyChange(item)">
            <el-option
                v-for="(option, index) in listB.kbyList"
                :key="index"
                :label="option.sampleNumber"
                :value="option.sampleNumber">
            </el-option>
          </el-select>
        </td>
        <td colspan="2" style="text-align: center">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.kb_ypnd"/>
        </td>
        <td colspan="2" style="text-align: center">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.kb_zkyq"/>
        </td>
        <td colspan="2" style="text-align: center">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.kb_sfhg"/>
        </td>
      </tr>
      <tr>
        <td colspan="8" style="text-align: center">平行样测定</td>
      </tr>
      <tr>
        <td colspan="2">平行样编号</td>
        <td colspan="2">
          <div style="display: flex;align-items: center;width: 100%;">
            <div style="display: flex;align-items: center;width: 50%;">
              (
              <el-select v-model="waterForm.pxycd_fx.bt_1" placeholder="请选择"
                         filterable
                         allow-create
                         default-first-option
                         style="width: 100%; border: 1px solid transparent"
                         @change="handlePxyChange('bt_1')">
                <el-option
                    v-for="(option, index) in listB.pxyList"
                    :key="index"
                    :label="option.sampleNumber"
                    :value="option.sampleNumber">
                </el-option>
              </el-select>
              )
            </div>
            <div style="display: flex;align-items: center;width: 50%;">
              (
              <el-select v-model="waterForm.pxycd_fx.bt_2" placeholder="请选择"
                         filterable
                         allow-create
                         default-first-option
                         style="width: 100%; border: 1px solid transparent"
                         @change="handlePxyChange('bt_2')">
                <el-option
                    v-for="(option, index) in listB.pxyList"
                    :key="index"
                    :label="option.sampleNumber"
                    :value="option.sampleNumber">
                </el-option>
              </el-select>
              )
            </div>
          </div>
        </td>
        <td colspan="2">
          <div style="display: flex;align-items: center">
            <div style="display: flex;align-items: center;width: 50%;">
              (
              <el-select v-model="waterForm.pxycd_fx.bt_3" placeholder="请选择"
                         filterable
                         allow-create
                         default-first-option
                         style="width: 100%; border: 1px solid transparent"
                         @change="handlePxyChange('bt_3')">
                <el-option
                    v-for="(option, index) in listB.pxyList"
                    :key="index"
                    :label="option.sampleNumber"
                    :value="option.sampleNumber">
                </el-option>
              </el-select>
              )
            </div>
            <div style="display: flex;align-items: center;width: 50%;">
              (
              <el-select v-model="waterForm.pxycd_fx.bt_4" placeholder="请选择"
                         filterable
                         allow-create
                         default-first-option
                         style="width: 100%; border: 1px solid transparent"
                         @change="handlePxyChange('bt_4')">
                <el-option
                    v-for="(option, index) in listB.pxyList"
                    :key="index"
                    :label="option.sampleNumber"
                    :value="option.sampleNumber">
                </el-option>
              </el-select>
              )
            </div>
          </div>
        </td>
        <td colspan="2">
          <div style="display: flex;align-items: center">
            <div style="display: flex;align-items: center;width: 50%;">
              (
              <el-select v-model="waterForm.pxycd_fx.bt_5" placeholder="请选择"
                         filterable
                         allow-create
                         default-first-option
                         style="width: 100%; border: 1px solid transparent"
                         @change="handlePxyChange('bt_5')">
                <el-option
                    v-for="(option, index) in listB.pxyList"
                    :key="index"
                    :label="option.sampleNumber"
                    :value="option.sampleNumber">
                </el-option>
              </el-select>
              )
            </div>
            <div style="display: flex;align-items: center;width: 50%;">
              (
              <el-select v-model="waterForm.pxycd_fx.bt_6" placeholder="请选择"
                         filterable
                         allow-create
                         default-first-option
                         style="width: 100%; border: 1px solid transparent"
                         @change="handlePxyChange('bt_6')">
                <el-option
                    v-for="(option, index) in listB.pxyList"
                    :key="index"
                    :label="option.sampleNumber"
                    :value="option.sampleNumber">
                </el-option>
              </el-select>
              )
            </div>
          </div>
        </td>
      </tr>
      <tr>
        <td colspan="2">测定浓度（
          <el-input placeholder="请输入"
                    v-model="waterForm.unit.px_cdnd" style="width: 20%;"></el-input>
          ）
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.cdnd_1"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.cdnd_2"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.cdnd_3"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.cdnd_4"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.cdnd_5"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.cdnd_6"/>
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <el-radio-group v-model="waterForm.pxycd_fx.px_xdpc">
            <el-radio value="Value 1">相对偏差</el-radio>
            <el-radio value="Value 2">自定义</el-radio>
          </el-radio-group>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_xdpc1"/>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_xdpc2"/>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_xdpc3"/>
        </td>
      </tr>
      <tr>
        <td colspan="2">质控要求</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_zkyq1"/>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_zkyq2"/>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_zkyq3"/>
        </td>
      </tr>
      <tr>
        <td colspan="2">是否合格</td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_sfhg1"/>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_sfhg2"/>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="waterForm.pxycd_fx.px_sfhg3"/>
        </td>
      </tr>
      <tr>
        <td colspan="8" style="text-align: center">标准样品测定</td>
      </tr>
      <tr>
        <td colspan="2">样品批号</td>
        <td colspan="2">测定浓度（
          <el-input placeholder="请输入"
                    v-model="waterForm.unit.bz_cdnd" style="width: 20%;"></el-input>
          ）
        </td>
        <td colspan="2">标准值（
          <el-input placeholder="请输入"
                    v-model="waterForm.unit.bz_bzz" style="width: 20%;"></el-input>
          ）
        </td>
        <td colspan="2">是否合格</td>
      </tr>
      <tr v-for="(item, index) in waterForm.bzycd" :key="index">
        <td colspan="2">
          <el-select v-model="item.bz_ypph" placeholder="请选择"
                     filterable
                     allow-create
                     default-first-option
                     style="width: 100%; border: 1px solid transparent"
                     @change="handleBzyChange(item)">
            <el-option
                v-for="(option, index) in listB.bzyList"
                :key="index"
                :label="option.extractedContent"
                :value="option.extractedContent">
            </el-option>
          </el-select>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.bz_cdnd"/>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.bz_bzz"/>
        </td>
        <td colspan="2">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.bz_sfhg"/>
        </td>
      </tr>
      <tr>
        <td colspan="8" style="text-align: center">加标回收样测定</td>
      </tr>
      <tr>
        <td>样品编号</td>
        <td>标液浓度（
          <el-input placeholder="请输入"
                    v-model="waterForm.unit.jb_jbnd" style="width: 20%;"></el-input>
          ）
        </td>
        <td>加标量（
          <el-input placeholder="请输入"
                    v-model="waterForm.unit.jb_jbl" style="width: 20%;"></el-input>
          ）
        </td>
        <td>加标后样品含量/浓度(
          <el-input placeholder="请输入"
                    v-model="waterForm.unit.jb_jbhyphl" style="width: 20%;"></el-input>
          )
        </td>
        <td>原样品含量/浓度（
          <el-input placeholder="请输入"
                    v-model="waterForm.unit.jb_yyphl" style="width: 20%;"></el-input>
          ）
        </td>
        <td>回收率（%）</td>
        <td>质控要求</td>
        <td>是否合格</td>
      </tr>
      <tr v-for="(item, index) in waterForm.jbycd" :key="index">
        <td style="width: 200px;">
          <el-select v-model="item.jb_ybph" placeholder="请选择"
                     filterable
                     allow-create
                     default-first-option
                     style="width: 100%; border: 1px solid transparent"
                     @change="handleJzyChange(item)">
            <el-option
                v-for="(option, index) in listB.jbyList"
                :key="index"
                :label="option.sampleNumber"
                :value="option.sampleNumber">
            </el-option>
          </el-select>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.jb_bynd"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.jb_jbl"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.jb_jbhyphlnd"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.jb_yyphlnd"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.jb_hsl"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.jb_zkyq"/>
        </td>
        <td>
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入"
                    v-model="item.jb_sfhg2"/>
        </td>
      </tr>
      <tr>
        <td>备注</td>
        <td colspan="7">
          <el-input style="width: 100%;border: 1px solid transparent" placeholder="请输入" v-model="waterForm.bnotes"/>
        </td>
      </tr>
    </table>
  </el-card>
</template>

<style scoped lang="scss">
.table {
  width: 100%;
  border-collapse: collapse;
  /* 表格边框合并 */
  text-align: left;
  /* 默认左对齐 */
  font-size: 14px;
  /* 字体大小 */
  color: #606266;
  /* 默认字体颜色 */
  margin-bottom: 20px;
}

.table th,
.table td {
  border: 1px solid #c2bfbf;
  /* 表格单元格边框颜色 */
  padding: 10px;
  /* 单元格内边距 */
}

.table th {
  background: #f5f7fa;
  /* 表头背景色 */
  font-weight: 600;
  /* 表头字体加粗 */
  color: #303133;
  /* 表头字体颜色 */
  text-align: center;
  /* 表头居中 */
}

.table-td {
  display: flex;
}

::v-deep .el-input__wrapper {
  background-color: transparent;
  box-shadow: none;
}

::v-deep .el-select__wrapper {
  background-color: transparent;
  box-shadow: none;
}

::v-deep .el-input-group__append {
  background-color: transparent;
  box-shadow: none;
}
</style>
